/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author niit
 */
@Entity
@Table(name = "fl_feedback")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FlFeedback.findAll", query = "SELECT f FROM FlFeedback f"),
    @NamedQuery(name = "FlFeedback.findByFeedbackid", query = "SELECT f FROM FlFeedback f WHERE f.feedbackid = :feedbackid"),
    @NamedQuery(name = "FlFeedback.findByFeedbackText", query = "SELECT f FROM FlFeedback f WHERE f.feedbackText = :feedbackText"),
    @NamedQuery(name = "FlFeedback.findByDateOfPosting", query = "SELECT f FROM FlFeedback f WHERE f.dateOfPosting = :dateOfPosting")})
public class FlFeedback implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "feedbackid")
    private Integer feedbackid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2000)
    @Column(name = "feedbackText")
    private String feedbackText;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dateOfPosting")
    @Temporal(TemporalType.DATE)
    private Date dateOfPosting;
    @JoinColumn(name = "studentid", referencedColumnName = "studentid")
    @ManyToOne(optional = false)
    private FlStudent studentid;

    public FlFeedback() {
    }

    public FlFeedback(Integer feedbackid) {
        this.feedbackid = feedbackid;
    }

    public FlFeedback(Integer feedbackid, String feedbackText, Date dateOfPosting) {
        this.feedbackid = feedbackid;
        this.feedbackText = feedbackText;
        this.dateOfPosting = dateOfPosting;
    }

    public Integer getFeedbackid() {
        return feedbackid;
    }

    public void setFeedbackid(Integer feedbackid) {
        this.feedbackid = feedbackid;
    }

    public String getFeedbackText() {
        return feedbackText;
    }

    public void setFeedbackText(String feedbackText) {
        this.feedbackText = feedbackText;
    }

    public Date getDateOfPosting() {
        return dateOfPosting;
    }

    public void setDateOfPosting(Date dateOfPosting) {
        this.dateOfPosting = dateOfPosting;
    }

    public FlStudent getStudentid() {
        return studentid;
    }

    public void setStudentid(FlStudent studentid) {
        this.studentid = studentid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (feedbackid != null ? feedbackid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FlFeedback)) {
            return false;
        }
        FlFeedback other = (FlFeedback) object;
        if ((this.feedbackid == null && other.feedbackid != null) || (this.feedbackid != null && !this.feedbackid.equals(other.feedbackid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FlFeedback[ feedbackid=" + feedbackid + " ]";
    }
    
}
